package com.example.activity04;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.app.Activity;
import android.content.Intent;

public class MainActivity extends Activity {
	private Button myButton = null;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        myButton = (Button)findViewById(R.id.myButton);
        myButton.setText(R.string.myButton);
        System.out.println("First Activity:OnCreate");
        myButton.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent intent = new Intent();
				intent.setClass(MainActivity.this, otherActivity.class);
				MainActivity.this.startActivity(intent);
			}
		});
    }
	@Override
	protected void onPause() {
		 System.out.println("First Activity:OnPause");
		super.onPause();
	}
	@Override
	protected void onRestart() {
		 System.out.println("First Activity:OnRestart");
		super.onRestart();
	}
	@Override
	protected void onResume() {
		 System.out.println("First Activity:OnResume");
		super.onResume();
	}
	@Override
	protected void onStart() {
		 System.out.println("First Activity:OnStart");
		super.onStart();
	}
	@Override
	protected void onStop() {
		 System.out.println("First Activity:OnStop");
		super.onStop();
	}
	@Override
	protected void onDestroy() {
		 System.out.println("First Activity:OnDestroy");
		super.onDestroy();
	}
    
    
}
